package com.test.pojo;

import org.beetl.sql.core.annotatoin.AssignID;
import org.beetl.sql.core.annotatoin.AutoID;
import org.beetl.sql.core.annotatoin.Table;

import java.text.SimpleDateFormat;
import java.util.Date;



public class User  {


    private Integer age ;

    @AssignID                       //指定为主键   @AutoId 指定为自增主键
    private Integer id ;
    private String name ;
    private Date createDate ;



    public String getCreateDateStr() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        if (getCreateDate()!=null){
            return simpleDateFormat.format(getCreateDate());
        }else{
            return "";
        }

    }



    public User(Integer id, Integer age, String name, Date createDate) {


        this.id = id;
        this.age = age;
        this.name = name;
        this.createDate = createDate;

    }

    public User() {
    }


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    @Override
    public String toString() {
        System.out.println("调用toString方法");

        return "User{" +
                "id=" + id +
                ", age=" + age +
                ", name='" + name + '\'' +
                ", createDate=" + createDate +
                '}';
    }
}
